import template from '../template';

class Consignee {
  constructor() {

  }

  static getList() {
    return template({
      url: 'consignee/list'
    });
  }

  static save(consignee) {
    let url = 'consignee/store';
    if (Number(consignee.id) > 0) {
      url = 'consignee/update';
    } else {
      delete consignee.id;
    }

    return template({
      url: url,
      method: 'post',
      data: consignee
    });

  }

  static del(id) {
    return template({
      url: 'consignee/consignee',
      method: 'delete',
      data: {id}
    });
  }
  
}

export default Consignee;
